﻿using Main.UI;
using Main.UI.Components;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Main.Engine
{
    partial class ComponentManager : IComponentManager
    {
        public IEnumerable<IComponent> Components
        {
            get { return COMPONENTS.Values; }
        }

        public T Find<T>() where T : IComponent
        {
            if (!COMPONENTS.ContainsKey(typeof(T)))
                throw new NotImplementedException(string.Format("The requested service [{0}] has not been implemeted or registered", typeof(T).Name));
            return (T) COMPONENTS[typeof(T)];
        }

        public IDockPanel StudioDock { get { return DockPanelWrapper.Instance; } }
        public IRibbonBar RibbonBar { get { return RibbonBarWrapper.Instance; } }
    }
}
